﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
namespace PrintDrawing.BaseClassDraw
{
    public class TextBoxDrawn:TextBox 
    {
        private string _nameTable = "";
        public string _value = "";
        public string NameTable
        {
            get { return _nameTable; }
            set { _nameTable = value; }
        }
        private string _nameColumn = "";

        public string NameColumn
        {
            get { return _nameColumn; }
            set { _nameColumn = value;
            ToolTip = value;
            }
        }
        private bool _isValue = true;

        public bool IsValue
        {
            get { return _isValue; }
            set { _isValue = value; }
        }

        public void MoveLeft(int x)
        {
            Canvas.SetLeft(this, Canvas.GetLeft(this)-x );
        }
        public void MoveRight(int x)
        {
            Canvas.SetLeft(this, Canvas.GetLeft(this) + x);
        }
        public void MoveUp(int x)
        {
            Canvas.SetTop(this, Canvas.GetTop(this) - x);
        }
        public void MoveDown(int x)
        {
            Canvas.SetTop(this, Canvas.GetTop(this) + x);
        }

        public void SetHeight(int x)
        {
            this.Height = this.Height + x;
        }

        public void SetWidth(int x)
        {
            this.Width = this.Width + x;
        }

        internal void Incfont()
        {
            if (this.FontSize < 32)
            {
                this.FontSize = this.FontSize + 2;
            }
        }
        internal void Uincfont()
        {
            if (this.FontSize > 6)
            {
                this.FontSize = this.FontSize - 2;
            }
        }
        internal void ToBold()
        {
            if (this.FontWeight == FontWeights.Bold)
            {
                this.FontWeight = FontWeights.Normal;
            }
            else
            {
                this.FontWeight = FontWeights.Bold;                
            }
        }
        internal void ToItalic()
        {
            if (this.FontStyle == FontStyles.Italic)
            {
                this.FontStyle = FontStyles.Normal;
            }
            else
            {
                this.FontStyle = FontStyles.Italic;

            }
        }       
    }
}
